package com.roger.springcloudFinchley.controller;

import com.roger.springcloudFinchley.config.RestTemplateConfig;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * Created by admin on 2019/12/20.
 */
@RestController
@RequestMapping(value = "/client")
public class ClientController {

    @GetMapping(value = "/get")
    public String get(@RequestParam("name") String name){
        String url = "http://localhost:8080/provider/get?name=" + name;
        ResponseEntity<String> responseEntity = RestTemplateConfig.myGet(url);
        return responseEntity.getBody();
    }
}
